<?php 
    foreach($listtin as $val){
?> 
<div class="box-sitebar">
    <button class="btn btn-primary btn-mini pull-right fix-button" type="button">Xem tất cả</button>
    <div class="bg-sitebar">
        <p><?php echo $val['name'];?></p>
    </div>
    <div class="box-product-new">
        <table>
            <tr>
                <?php 
                    $dem = 0;
                    foreach($val['list'] as $value){
                    if($dem % 3 == 0 && $dem != 0) echo '</tr><tr>';
                ?>
                <td valign="top" align="left">
                    <div class="box-border-product">
                        <div class="box-img"><img src="<?php echo DOMAIN;?>img/<?php echo $value['Product']['images'];?>" title="<?php echo $value['Product']['name'];?>" alt="<?php echo $value['Product']['name'];?>"/></div>
                        <a href="<?php echo DOMAIN.$value['Product']['link'],'.html';?>" title="<?php echo $value['Product']['name'];?>">
                            <h3><?php echo $value['Product']['name'];?></h3>
                        </a>
                        <p class="price">
                            <?php if(is_numeric($value['Product']['price'])) echo number_format($value['Product']['price']);?> VNĐ
                        </p>
                    </div>
                </td>
                <?php $dem ++;}?>
            </tr>
        </table>
    </div><!--end box-product-new-->
</div><!--end box-sitebar-->
<?php }?>